import React from 'react';
import { connect } from 'dva';
import { TabBar, Icon } from 'antd-mobile';
import { routerRedux } from 'dva/router';
import content from '../../common/contentCss/content.css';
import styles from './common.css';
import CustTitle from '../../common/title/title';
import FootBtn from './pages/footBtn/btn';

import JobConsult from './pages/jobConsult/jobConsult';


function JobConsultList({loading,dispatch,jobConsultList}) {

  const { jobConsults } = jobConsultList;

  const titleProps = {
    titleName:'咨询',
    goBack(){
      dispatch(routerRedux.goBack());
    },
  }

  const MarginHeight = () => <div style={{height: '0.6em', backgroundColor:'#F2F2F2'}}></div>;
  const CustLine = () => <div style={{width: '100%', height:'1px', backgroundColor:'#E4E4E4'}}></div>;

  const footProps = {
    textValue:'我要咨询',
    onOk(){
      console.log('咨询');
      dispatch(routerRedux.push({
        pathname: '/consultation',
      }));
    },
  }
  const jobConsultProps = {
    jobConsults
  }

  return (
    <div className={content.content} style={{backgroundColor:'#fff'}}>
      <CustTitle {...titleProps}/>
      <div style={{
        marginTop: '2.9em',
        marginBottom:'3.375em'
      }}>
      </div>
      <JobConsult {...jobConsultProps}/>
      <div className={styles.foot}>
        <FootBtn {...footProps}/>
      </div>
    </div>
  )
}

function mapStateToProps(state, ownProps) {
  return {
    loading: state.loading.global,
    jobConsultList: state.jobConsultList
  }
}
export default connect(mapStateToProps)(JobConsultList);
